var wxRequest = require('../../utils/wxRequest')
var Common = require('../../utils/common');
const app = getApp();
const order = ['red', 'yellow', 'blue', 'green', 'red']
Page({

  /**
   * 页面的初始数据
   */
  data: {
    toView: 'red',
    scrollTop: 100,

    list: [{
      "title": "家常菜",
      "img": "https://www.hiphantom.com/image/lite/mrcp0.png",
      "num": 29974,
      "l": "家庭选择"
    },
    {
      "title": "汤粥主食",
      "img": "https://www.hiphantom.com/image/lite/mrcp1.png",
      "num": 7680,
      "l": "家庭选择"
    },
    {
      "title": "下饭菜",
      "img": "https://www.hiphantom.com/image/lite/mrcp2.png",
      "num": 5430,
      "l": "家庭选择"
    },
    {
      "title": "甜品饮品",
      "img": "https://www.hiphantom.com/image/lite/mrcp3.png",
      "num": 8086,
      "l": "家庭选择"
    },
      {
        "title": "肉类",
        "img": "https://www.hiphantom.com/image/lite/mrcp4.png",
        "num": 6635,
        "l": "家庭选择"
      },
      {
        "title": "懒人食谱",
        "img": "https://www.hiphantom.com/image/lite/mrcp5.png",
        "num": 12313,
        "l": "家庭选择"
      },
      {
        "title": "早餐",
        "img": "https://www.hiphantom.com/image/lite/mrcp6.png",
        "num": 25678,
        "l": "家庭选择"
      },
      {
        "title": "健身低卡",
        "img": "https://www.hiphantom.com/image/lite/mrcp7.png",
        "num": 8896,
        "l": "家庭选择"
      },
      {
        "title": "蔬菜",
        "img": "https://www.hiphantom.com/image/lite/mrcp8.png",
        "num": 5678,
        "l": "家庭选择"
      },
      {
        "title": "异国风味",
        "img": "https://www.hiphantom.com/image/lite/mrcp9.png",
        "num": 5001,
        "l": "家庭选择"
      },

    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
    wx.navigateToMiniProgram({
      appId: 'wxb7d56a86bfb85f0c',
      path: 'pages/index/index',
      extraData: {
        foo: 'bar'
      },
      // envVersion: 'develop',
      success(res) {

      }
    })


  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

    wx.navigateToMiniProgram({
      appId: 'wxb7d56a86bfb85f0c',
      path: 'pages/index/index',
      extraData: {
        foo: 'bar'
      },
      // envVersion: 'develop',
      success(res) {

      }
    })



    // Common.showToast("即将开放，敬请期待");
    // setTimeout(function () {
    //   wx.switchTab({
    //     url: '/pages/index/index'
    //   })
    // }, 1000)
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },

  none: function (e) {
    app.toast('海南城市暂未开放此功能，敬请期待~');
  },


})